#if !SERVER
using ActorSystem;
using GameDesigner;
using Net.Client;
using Net.Component;
using Net.Share;
using UnityEngine;

namespace Example2
{
    public partial class AIMonster : Actor
    {
        protected override void EnterArea(in Operation opt)
        {
            base.EnterArea(opt);
            headBloodBar = Object.Instantiate(GameManager.I.headBloodBar, GameManager.I.UIRoot);
            headBloodBar.target = View.transform;
            headBloodBar.offset = headBarOffset;
            headBloodBar.text.text = $"{Property.Health}/{Property.HealthMax}";
            headBloodBar.image.fillAmount = (float)Property.Health / Property.HealthMax;
        }

        protected override ActorView GetViewPrefab()
        {
            return Object.FindAnyObjectByType<SceneManager>().actorViews[1];
        }
    }
}
#endif